package com.request; /**
 * @author wzm
 * @create 2023-03-06 10:49
 */

import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;

@WebServlet("/rs05")
public class RequestServlet05 extends HttpServlet {
    @Override
    protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
       //不用重写写代码 调用即可
        doPost(request,response);
    }

    @Override
    protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
        System.out.println("我是窗口A,我做了一些事情，接下来你要去B窗口处理");

        //在服务器内部资源在跳转   请求转发
/*        RequestDispatcher requestDispatcher = request.getRequestDispatcher("/rs06");//去哪里
        requestDispatcher.forward(request,response);//去资源里 携带着需要的参数*/

        //处理完业务以后携带一些数据 域对象
        request.setAttribute("msg","缴费单");

        request.getRequestDispatcher("/rs06").forward(request,response);
    }
}
